

#ifndef __GAME_EDITOR_H__
#define __GAME_EDITOR_H__


#include <QtGui/QtGui>
#include <QtCore/QtCore>
#include <QtXml/QtXml>
#include <QtOpenGL/QtOpenGL>

#define SAFE_DELETE(p)	\
	{	\
	if (p)	\
		{	\
		delete (p);	\
		(p) = 0;	\
		}	\
	}


#define SAFE_DELETE_ARRAY(p)	\
	{	\
	if (p)	\
		{	\
		delete [](p);	\
		(p) = 0;	\
		}	\
	}


#define DEFAULT_DIR					"default_dir"

#define GAME_EDITOR_VERSION_STR		"0.1.0"
#define GAME_EDITOR_VERSION			0x01000000
#define GAME_EDITOR_APP_NAME		"GameEditor"

#define PROJECT_EXT					"vproj"
#define ANIMATION_EXT				"anim"
#define SCENE_EXT					"scene"
#define OBJECT_EXT					"object"
#define SKILL_EXT					"skill"
#define ROLE_EXT					"role"


#define MAP_GRID_W					64
#define MAP_GRID_H					32

#define MAP_GRID_W_HALF				(MAP_GRID_W >> 1)
#define MAP_GRID_H_HALF				(MAP_GRID_H >> 1)

#define MAP_GRID_W_SHF				6
#define MAP_GRID_H_SHF				5

#define MAP_GRID_W_HALF_SHF			(MAP_GRID_W_SHF - 1)
#define MAP_GRID_H_HALF_SHF			(MAP_GRID_H_SHF - 1)

#define MAP_GRID_W_MASK				63
#define MAP_GRID_H_MASK				31


enum FileType
{
	FT_NONE = QListWidgetItem::UserType,
	FT_PROJECT,
	FT_ANIMATION,
	FT_SCENE,
	FT_OBJECT,
	FT_SKILL,
	FT_ROLE,
	FT_APF_FOLDER,
	FT_MPF_FOLDER,
	FT_PHOTO,
	FT_FOLDER
};


class MainWindow;
extern MainWindow *gMainWindow;


#endif	/*__GAME_EDITOR_H__*/
